package com.service.impl;

import com.dao.PaymentMapper;
import com.entity.HyPayment;
import com.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: honye-fang
 * @description:
 * @author: Baiyyy
 * @create: 2025-02-14 22:07
 **/
@Service
public class PaymentServiceImpl implements PaymentService {


    @Autowired
    private PaymentMapper paymentMapper;

    //添加支付记录
    @Override
    public Integer insertPayment(HyPayment hyPayment) {
        // 调用 Mapper 插入数据
        return paymentMapper.insertPayment(hyPayment);
    }

    //根据id查询支付记录
    @Override
    public HyPayment selectPaymentById(Long id) {
         return paymentMapper.selectPaymentById(id);
    }

    //更新支付状态
    @Override
    public int updatePaymentStatus(Long id, String paymentStatus) {
         return paymentMapper.updatePaymentStatus(id,paymentStatus);
    }
}
